package com.example.yls.wuxiqi;

import android.graphics.Canvas;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    private WuziqiPanel wuziqiPanel;
    private Button btnAgain;
    private Button btnHQ;
    private Button btnCC;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        wuziqiPanel = findViewById(R.id.wuziqi_WuziqiPanel);
        btnAgain = findViewById(R.id.btn_again);
        btnHQ = findViewById(R.id.btn_hq);
        btnCC = findViewById(R.id.btn_cc);
        btnAgain.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                wuziqiPanel.start();
            }
        });
        btnHQ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                wuziqiPanel.redo();
            }
        });
        btnCC.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                wuziqiPanel.toast();
            }
        });
    }
}
